/**
 * 
 */

var bt_guest_book_input, bt_guest_book_del, bt_guest_book_gomian;

function guest_book_init() {
	general();
	
}

function general() {
	
	
	bt_guest_book_gomain = document.getElementById('bt_guest_book_gomain');
	if(bt_guest_book_gomain != null){
		bt_guest_book_gomain.onclick = function(){
		var frm_gomain = document.hidden_guest_book_frm;
		frm_gomain.action = "index.jsp"; 
		frm_gomain.submit();
		}
	}
	
	bt_guest_book_input = document.getElementById('bt_guest_book_input');
	if(bt_guest_book_input != null){
		bt_guest_book_input.onclick = function(){
		0	
			var frm_input = document.hidden_guest_book_frm;
			var text = document.getElementById("tf_guest_book_input");
			if(text.value != "")
			{
				frm_input.g_text.value = text.value;
				frm_input.action = "index.jsp?page_set=./guest_book/guest_book_input.jsp";
				frm_input.submit();
			}
			else
			{
				alert("내용이 없습니다. 내용을 입력해주세요.");
			}
			
		}
	}
	
}
	
	
	function goPage(page)
	{
		
		var mf = document.hidden_guest_book_frm;
		mf.now_page.value = page;
		mf.action = "index.jsp?page_set=./guest_book.jsp";
		mf.submit();

	}

	
	function guest_book_del(g_rno)
	{
		var b = confirm("정말 삭제하시겠습니까?");
		var mf = document.del_del;
		if(b)
		{
			alert("삭제를 성공하였습니다.");
			mf.g_rno.value = g_rno;
			mf.submit();
		}else{
			alert("삭제가 취소되었습니다.");
		}
			
		
	}
	
